// forwardRef

import { forwardRef, useRef } from "react"

// function Son () {
//   return <input type="text"  />
// }

const Son = forwardRef((props, ref) => {
  return <input type='text' ref={ref}></input>
})

const Board = () => {
  const sonRef = useRef(null)
  const showRef = () => {
    console.log(sonRef)
    sonRef.current.focus()
  }
  return (
    <div>
      <Son ref={sonRef}></Son>
      <button onClick={showRef}>focus</button>
    </div>
  );
}

export default Board